#ifndef TC_DBC_HPP
#define TC_DBC_HPP

/** \file DBC.hpp
 * Declarations for DBC (Design by Contract) macros.
 *
 * (c) Copyright  Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id$
 *
 *
 */

#include "Global.hh"
#include "Assert.hpp"


#if TC_NODEBUG

# define TC_INVARIANT()             ((void)0)
# define TC_CHECK_INVARIANT(INV)    ((void)0)
# define TC_PRE_CONDITION(PRE)      ((void)0)
# define TC_POST_CONDITION(PDT)     ((void)0)

#else

//! Check if the invariant holds
# define TC_INVARIANT()                                   \
   TC_ASSERT_LEVEL(::TC::e_ALInvariant,this->invariant())

//! Check a specific invariant holds
# define TC_CHECK_INVARIANT(INV) \
   TC_ASSERT_LEVEL(::TC::e_ALInvariant,INV);

//! Macro for only checking pre-conditions
# define TC_PRE_CONDITION(PRE)  \
   TC_ASSERT_LEVEL(::TC::e_ALPrePost,PRE)

//! Macro for only checking post-conditions
# define TC_POST_CONDITION(PST) \
   TC_ASSERT_LEVEL(::TC::e_ALPrePost,PST)

#endif /* TC_NODEBUG */

     
#endif /* Include guard */
